import heapq

portfolio = [

    {'name': 'IBM' , 'price'  :90 },
    {'name': 'FB'  , 'price'  :45 },
    {'name': 'ACME', 'price' :56 }
]

cheap = heapq.nsmallest(2,portfolio, key = lambda x: x['price'])
print (cheap)

def customCheap():

    counter      = 0
    listOfItem   = []
    default_data = dict()
    key = lambda x: x['price']
    for i in portfolio:
        listOfItem.append(key(i))
        default_data.update({key(i): counter})
        counter = counter + 1
        
    print (max(listOfItem))
    print (default_data[max(listOfItem)])
    
    return portfolio[default_data[max(listOfItem)]]

#example test
print (customCheap())
